package com.yonyou.ucf.mdf.app.isvdxq.other.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.gson.Gson;
import com.yonyou.iuap.yms.annotation.*;
import com.yonyou.iuap.yms.param.BaseEntity;
import com.yonyou.ucf.mdf.app.isvdxq.other.model.TimeBean;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@YMSEntity
@YMSTable(tableName = "dxqyy_product")
public class ProductEntity extends BaseEntity {

    @YMSId
    @YMSGeneratedValue(domain = "p-scc-tl-p00t-gdgy01")
    @YMSColumn(name = "id")
    private Long id;

    @YMSColumn(name = "code")
    private String code;

    @YMSColumn(name = "productName")
    private String productName;

    private String shortName;

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
        this.productName = shortName;
    }

    private String stopstatus;

    public String getStopstatus() {
        return stopstatus;
    }

    public void setStopstatus(String stopstatus) {
        this.stopstatus = stopstatus;
        this.isStop = stopstatus;
        this.isEnabled = stopstatus.equals("false") ? "true" : "false";
    }

    @YMSColumn(name = "unit")
    private String unit;

    @YMSColumn(name = "unitUseType")
    private Integer unitUseType;

    @YMSColumn(name = "defaultSKUId")
    private String defaultSKUId;

    @YMSColumn(name = "orgId")
    private String orgId;

    @YMSColumn(name = "orgId_Name")
    private String orgId_Name;

    @YMSColumn(name = "stockUnit")
    private String stockUnit;

    @YMSColumn(name = "productApplyRangeId")
    private String productApplyRangeId;

    @YMSColumn(name = "productApplyRange_OrgId")
    private String productApplyRange_OrgId;

    //商品分类、辅助分类
    @YMSColumn(name = "productClass")
    private String productClass;

    @YMSColumn(name = "productClass_Code")
    private String productClass_Code;

    //物料分类
    @YMSColumn(name = "manageClass")
    private String manageClass;

    @YMSColumn(name = "manageClass_Code")
    private String manageClass_Code;

    @YMSColumn(name = "isAuthorizationManager")
    private String isAuthorizationManager;

    @YMSColumn(name = "eventNotify_status")
    private String eventNotify_status;

    @YMSColumn(name = "isEnabled")
    private String isEnabled;

    @YMSColumn(name = "isStop")
    private String isStop;

    @YMSColumn(name = "isCreator")
    private String isCreator;

    @YMSColumn(name = "isRegistrationManager")
    private String isRegistrationManager;

    @YMSColumn(name = "hasSpecs")
    private String hasSpecs;

    @YMSColumn(name = "realProductAttribute")
    private Integer realProductAttribute;

    @YMSColumn(name = "realProductAttributeType")
    private Integer realProductAttributeType;

    @YMSColumn(name = "modifier")
    private String modifier;

    @YMSColumn(name = "modifierId")
    private String modifierId;

    @YMSColumn(name = "modifyTime")
    private String modifyTime;

    @YMSColumn(name = "pubts")
    private String pubts;

    @YMSColumn(name = "ytenant_id")
    private String tenantId;

    private Boolean isRecommend = false;

    //条形码
    private String barCode;

    //模板ID
    private String productTemplate;

    //启用辅计量, true:启用、false：停用
    private Boolean enableAssistUnit = false;

    //序列号管理, true:是、false:否、
    private Boolean isSerialNoManage = false;

    //条码管理, true:是、false:否、
    private Boolean isBarcodeManage = false;

    //允许负库存, true:是、false:否、
    private Boolean allowNegativeInventory = false;

    //批次管理, true:是、false:否、
    private Boolean isBatchManage = false;

    //有效期管理, true:是、false:否、
    private Boolean isExpiryDateManage = false;

    // 用于到期时间计算
    //保质期
    private Integer expireDateNo;

    //保质期单位, 1:年、2:月、6:天
    private String expireDateUnit;

    //有效期推算方式：0日 1月 2不推算
    private Integer isExpiryDateCalculationMethod;

    //近效期拒收天数
    private Integer daysBeforeValidityReject;

    //近效期预警天数
    private Integer validityWarningDays;

    // 记录用友原始数据
    @YMSColumn(name = "remark_dxq")
    private String remark_dxq;

    //是否需要同步 1是 0否
    @YMSColumn(name = "isRefresh_dxq")
    private Integer isRefresh_dxq = 0;

    // 兼容订阅数据
    public void set_status(String _status) {
        if (_status == "Update") super.set_status(1);
        else if (_status == "Insert") {
            super.set_status(0);
        }
    }

    public Boolean getIsRecommend() {
        return isRecommend;
    }

    public void setIsRecommend(Boolean isRecommend) {
        this.isRecommend = isRecommend;
    }

    public Boolean getIsSerialNoManage() {
        return isSerialNoManage;
    }

    public void setIsSerialNoManage(Boolean isSerialNoManage) {
        this.isSerialNoManage = isSerialNoManage;
    }

    public Boolean getIsBarcodeManage() {
        return isBarcodeManage;
    }

    public void setIsBarcodeManage(Boolean isBarcodeManage) {
        this.isBarcodeManage = isBarcodeManage;
    }

    public Boolean getIsBatchManage() {
        return isBatchManage;
    }

    public void setIsBatchManage(Boolean isBatchManage) {
        this.isBatchManage = isBatchManage;
    }

    public Boolean getIsExpiryDateManage() {
        return isExpiryDateManage;
    }

    public void setIsExpiryDateManage(Boolean isExpiryDateManage) {
        this.isExpiryDateManage = isExpiryDateManage;
    }

    public String getRemark_dxq() {
        return remark_dxq;
    }

    public void setRemark_dxq(String remark_dxq) {
        this.remark_dxq = remark_dxq;
    }

    public Integer getIsRefresh_dxq() {
        return isRefresh_dxq;
    }

    public void setIsRefresh_dxq(Integer isRefresh_dxq) {
        this.isRefresh_dxq = isRefresh_dxq;
    }

    public Integer getExpireDateNo() {
        return expireDateNo;
    }

    public void setExpireDateNo(Integer expireDateNo) {
        this.expireDateNo = expireDateNo;
    }

    public String getExpireDateUnit() {
        return expireDateUnit;
    }

    public void setExpireDateUnit(String expireDateUnit) {
        this.expireDateUnit = expireDateUnit;
    }

    public Integer getIsExpiryDateCalculationMethod() {
        return isExpiryDateCalculationMethod;
    }

    public void setIsExpiryDateCalculationMethod(Integer isExpiryDateCalculationMethod) {
        this.isExpiryDateCalculationMethod = isExpiryDateCalculationMethod;
    }

    public Integer getDaysBeforeValidityReject() {
        return daysBeforeValidityReject;
    }

    public void setDaysBeforeValidityReject(Integer daysBeforeValidityReject) {
        this.daysBeforeValidityReject = daysBeforeValidityReject;
    }

    public Integer getValidityWarningDays() {
        return validityWarningDays;
    }

    public void setValidityWarningDays(Integer validityWarningDays) {
        this.validityWarningDays = validityWarningDays;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public Boolean getEnableAssistUnit() {
        return enableAssistUnit;
    }

    public String getProductTemplate() {
        return productTemplate;
    }

    public void setProductTemplate(String productTemplate) {
        this.productTemplate = productTemplate;
    }

    public void setEnableAssistUnit(Boolean enableAssistUnit) {
        this.enableAssistUnit = enableAssistUnit;
    }

    public Boolean getAllowNegativeInventory() {
        return allowNegativeInventory;
    }

    public void setAllowNegativeInventory(Boolean allowNegativeInventory) {
        this.allowNegativeInventory = allowNegativeInventory;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Integer getUnitUseType() {
        return unitUseType;
    }

    public void setUnitUseType(Integer unitUseType) {
        this.unitUseType = unitUseType;
    }

    public String getStockUnit() {
        return stockUnit;
    }

    public void setStockUnit(String stockUnit) {
        this.stockUnit = stockUnit;
    }

    public String getDefaultSKUId() {
        return defaultSKUId;
    }

    public void setDefaultSKUId(String defaultSKUId) {
        this.defaultSKUId = defaultSKUId;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getOrgId_Name() {
        return orgId_Name;
    }

    public void setOrgId_Name(String orgId_Name) {
        this.orgId_Name = orgId_Name;
    }

    public String getProductApplyRangeId() {
        return productApplyRangeId;
    }

    public void setProductApplyRangeId(String productApplyRangeId) {
        this.productApplyRangeId = productApplyRangeId;
    }

    public String getProductApplyRange_OrgId() {
        return productApplyRange_OrgId;
    }

    public void setProductApplyRange_OrgId(String productApplyRange_OrgId) {
        this.productApplyRange_OrgId = productApplyRange_OrgId;
    }

    public String getProductClass() {
        return productClass;
    }

    public void setProductClass(String productClass) {
        this.productClass = productClass;
    }

    public String getProductClass_Code() {
        return productClass_Code;
    }

    public void setProductClass_Code(String productClass_Code) {
        this.productClass_Code = productClass_Code;
    }

    public String getManageClass() {
        return manageClass;
    }

    public void setManageClass(String manageClass) {
        this.manageClass = manageClass;
    }

    public String getManageClass_Code() {
        return manageClass_Code;
    }

    public void setManageClass_Code(String manageClass_Code) {
        this.manageClass_Code = manageClass_Code;
    }

    public String getEventNotify_status() {
        return eventNotify_status;
    }

    public void setEventNotify_status(String eventNotify_status) {
        this.eventNotify_status = eventNotify_status;
    }

    public String getIsEnabled() {
        return isEnabled;
    }

    public void setIsEnabled(String isEnabled) {
        this.isEnabled = isEnabled;
    }

    public String getIsStop() {
        return isStop;
    }

    public void setIsStop(String isStop) {
        this.isStop = isStop;
    }

    public String getIsAuthorizationManager() {
        return isAuthorizationManager;
    }

    public void setIsAuthorizationManager(String isAuthorizationManager) {
        this.isAuthorizationManager = isAuthorizationManager;
    }

    public String getIsCreator() {
        return isCreator;
    }

    public void setIsCreator(String isCreator) {
        this.isCreator = isCreator;
    }

    public String getIsRegistrationManager() {
        return isRegistrationManager;
    }

    public void setIsRegistrationManager(String isRegistrationManager) {
        this.isRegistrationManager = isRegistrationManager;
    }

    public String getHasSpecs() {
        return hasSpecs;
    }

    public void setHasSpecs(String hasSpecs) {
        this.hasSpecs = hasSpecs;
    }

    public Integer getRealProductAttribute() {
        return realProductAttribute;
    }

    public void setRealProductAttribute(Integer realProductAttribute) {
        this.realProductAttribute = realProductAttribute;
    }

    public Integer getRealProductAttributeType() {
        return realProductAttributeType;
    }

    public void setRealProductAttributeType(Integer realProductAttributeType) {
        this.realProductAttributeType = realProductAttributeType;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public String getModifierId() {
        return modifierId;
    }

    public void setModifierId(String modifierId) {
        this.modifierId = modifierId;
    }

    public String getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(String modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getPubts() {
        return pubts;
    }

    public void setPubts(String pubts) {
        this.pubts = pubts;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    private TimeBean time;

    public TimeBean getTime() {
        return time;
    }

    public void setTime(TimeBean time) {
        this.time = time;
    }
}
